home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.sept.archive / 000078_crash!fwi.uva.nl!oortmers_Thu, 30 Sep 93 02:23:11 PST.msg < prev    next >
Text File  |  1993-11-02  |  3KB  |  84 lines

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Thu, 30 Sep 93 02:23:11 PST
  3. Received: from mail.fwi.uva.nl by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #18) id m0oiCFL-0000K3C; Wed, 29 Sep 93 17:51 PDT
  5. Received: from gene.fwi.uva.nl by mail.fwi.uva.nl with SMTP (5.65c/5.1)
  6.           id AA20398; Thu, 30 Sep 1993 01:51:46 +0100
  7. Received: by gene.fwi.uva.nl
  8.           id AA28999; Thu Sep 30 01:51:45 1993
  9. Message-Id: <199309300051.AA28999@gene.fwi.uva.nl>
  10. Date: Thu, 30 Sep 1993 01:51:45 +0100
  11. Return-Path: <oortmers@fwi.uva.nl>
  12. X-Organisation: Faculty of Mathematics & Computer Science
  13.                 University of Amsterdam
  14.                 Plantage Muidergracht 24
  15.                 NL-1018 TV Amsterdam
  16.                 The Netherlands
  17. X-Phone:        +31 20 525 5200
  18. X-Telex:        16460 facwn nl
  19. X-Fax:          +31 20 525 5101
  20. From: oortmers@fwi.uva.nl (Wouter van Oortmerssen (Alfa_Inf92))
  21. To: amigae@bkhouse.cts.com
  22. Subject: GTSL_DISPFUNC
  23.  
  24.  
  25. >> Hi all,
  26. >> 
  27. >> I'm having probs with a slidergadget and it's GTSL_DISPFUNC tagitem. This
  28. >> tagitem is meant to add a function to the slider that calculates the level
  29. >> to be displayed near to the slider.
  30.  
  31. It seems like there are some uncertainties about how to call E
  32. procedures from other places (like tasks). The problems with this is
  33. that lots of E code is dependant on a global environment, which demands
  34. pretty tricky code to restore. that's why with v2.5 there'll probably
  35. be modules for tasks, hooks etc.
  36.  
  37. >> For example, it may be needed to use the slider to select a screen depth,
  38. >> while the levelvalue is the number of colours, here 2^level.
  39.  
  40. with a function like this we can do it the easy way, since computing
  41. 2^level doesn't require an environment.
  42.  
  43. >> The problem is that I can't attach a function (a PROC) to this tag properly,
  44. >> as the system crashes when I move the slider (and the system wants to call
  45. >> my function calculate the according value to be displayed.
  46. >> 
  47. >> I attach the function as follows:
  48. >> 
  49. >> GTSL_DISPFUNC,{calculatelevel}
  50. >> 
  51. >> but I have no idea how the function should read the arguments it gets, (I
  52. >> believe a window pointer and a gadgetpointer, but I'm not sure as I don't
  53. >> carry my RKRM'S with me all the time :o)
  54. >> 
  55. >> Can anyone give an example of how this must be done?
  56.  
  57. sure, how about:
  58.  
  59.   IF (g:=CreateGadgetA(SLIDER_KIND,g,
  60.     [offx+150,offy+61,315,27,'slider:   ',tattr,2,0,visual,0]:newgadget,
  61.     [GTSL_MIN,1,
  62.      GTSL_MAX,5,
  63.      GTSL_LEVEL,2,
  64.      GTSL_MAXLEVELLEN,2,
  65.      GTSL_LEVELFORMAT,'\d[2]',
  66.      GTSL_DISPFUNC,{depth2colours},
  67.      NIL]))=NIL THEN RETURN NOGADGET
  68.  
  69.  
  70. and:
  71.  
  72. PROC depth2colours(level,gad:PTR TO gadget) RETURN Shl(1,level)
  73.  
  74. >> --
  75. >> Signatures sold out at the time....  Leon Woestenberg (leon@stack.urc.tue.nl)
  76. >> If lines are busy, try later. But DO call!
  77. >> --
  78.  
  79. Wouter
  80.  
  81.    ____  Wouter van Oortmerssen, Wouter@alf.let.uva.nl
  82.   / __/  "Einen Satz verstehen, heisst, wissen was der Fall ist,
  83.  / __/    wenn er wahr ist" - Wittgenstein
  84. /___/  ->subscribe to the E mailing list: amigae-request@bkhouse.cts.com<-